Ext.define('MyApp.view.navigation.NavigationPanel', {
    extend: 'MyApp.view.ux.BasePanelView',
    xtype: 'navigationPanel',
   	layout:'border',
    frame : true,
/*    tbar : [
	  { itemId:'addSame' ,text: '增加同级菜单' ,glyph:0xf15c ,disabled:true},
	  { itemId:'addNext' ,text: '增加下级菜单' ,glyph:0xf15c ,disabled:true},
	  { itemId:'save' ,text: '保存修改' ,glyph:0xf0c7,disabled:true },
	  {	itemId:'delete' ,text: '删除' ,glyph:0xf1f8,disabled:true},
	  '-'
	],*/
    items:[
    	{
    		xtype:'treepanel',
    		region: 'west',
    		store:'NavigationStore',
    		width: 300,
    		viewConfig: {
	            plugins: {
	                ptype: 'treeviewdragdrop'
	            }
	        },
    		useArrows: true,
    		title:'导航菜单树形结构',
    		rootVisible:false,
        	minWidth: 200
    	},
    	{
    		xtype:'panel',
    		region: 'center',
		    title:'&nbsp;',
		    autoScroll : true,
    		items:[
    			{
		    		xtype:'form',
		    		disabled:true,
		    		id:'form',
		    		fieldDefaults: {
							allowBlank: false,//不允许为空
							margin : '10',
							anchor: '50%',
							msgTarget: 'side',//验证显示方式
							labelAlign: 'right',//标签在右边
							labelWidth: 120//标签长度，
							
					},
		    		items:[
		    			{
		    				xtype:'textfield',
		    				name:'appName',
		    				afterLabelTextTpl: Ext.myUtil.required,
		    				fieldLabel: '导航标示'
		    			},
		    			{
		    				xtype:'textfield',
		    				name:'text',
		    				afterLabelTextTpl: Ext.myUtil.required,
		    				fieldLabel: '显示名称'
		    			},
		    			/*{
		    				xtype:'textfield',
		    				name:'icon',
		    				afterLabelTextTpl: Ext.myUtil.required,
		    				fieldLabel: '导航图标路径'
		    			},*/
		    			{
		    				triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',
		    				name:'icon',
		    				afterLabelTextTpl: Ext.myUtil.required,
		    				fieldLabel: '导航图标路径',
		    				onTriggerClick : function(){
		    					console.log(this.store);
						     /*   var me = this;
						
						        if (me.hasSearch) {
						            me.setValue('');
						            me.store.clearFilter();
						            me.hasSearch = false;
						            me.triggerCell.item(0).setDisplayed(false);
						            me.updateLayout();
						        }*/
						    },
		    				xtype: 'triggerfield'
		    			},
		    			{
		    				xtype:'textfield',
		    				name:'clazz',
		    				allowBlank: true,
		    				fieldLabel: '应用主页类名'
		    			},
		    			{
		    				xtype:'textfield',
		    				name:'controller',
		    				allowBlank: true,
		    				fieldLabel: '应用控制器名称'
		    			},
		    			{
		    				xtype:'textfield',
		    				name:'parentId',
		    				disabled:true,
		    				afterLabelTextTpl: Ext.myUtil.required,
		    				fieldLabel: '父级id'
		    			}
		    		]
		    	},{
		    		    xtype: 'grid',
					    forceFit:true ,//自动填满表格 
					    //sortableColumns :false,
					    title:'按钮列表',
					    autoScroll : true,
					    autoHeight: true,
					    defaults: { 
						},
						plugins:[  
					    ],
					    columns: [
					    	{ header: 'ID',  dataIndex: 'id',align:'center'},
					        { header: '按钮标示',  dataIndex: 'itemId'},
					        { header: '按钮名称',  dataIndex: 'text'},
					        { header: '按钮图标',  dataIndex: 'glyph'},
					        { header: '初始不可以',  dataIndex: 'disabled',
					        		renderer:Ext.myUtil.YorNFormat},
					        {header: '序号',  dataIndex: 'seq'}
					    ],
					    buttons : [
						  { itemId:'addrow' ,text: '增加' ,glyph:0xf15c ,disabled:true}
						]
		    	}
    		]
    	}
    ]
/*	viewConfig : {  
	    loadingText : "加载数据..."  
	}, 
	store:'NavigationStore'*/
});